package com.demo.bean.mapper.column;

import com.demo.common.entity.ColumnManagement;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
/**
 * 查询主栏目、次级栏目
 * 作者：孙佳佳
 */
@Mapper
@Repository
public interface ColumnMapper {

    /**
     * 查询所有主栏目
     * @return
     */
    @Select("select * from column_management where column_father_id = 0")
    List<ColumnManagement> selectAllParent();

    /**
     * 根据父id查询所有子栏目
     * @param columnFatherId
     * @return
     */
    @Select("select * from column_management where column_father_id = #{columnFatherId}")
    List<ColumnManagement> selectByFatherId(@Param("columnFatherId") Integer columnFatherId);
}
